package com.ccx.coachsite.ui.tutorial;

import java.util.List;

import android.content.Context;
import android.util.AttributeSet;

import com.ccx.coachsite.ui.customview.PageBarView;

public class TutorialPageBar extends PageBarView {

	private List<TutorialPageDataLoader> pageLoaders;

	public TutorialPageBar(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public TutorialPageBar(Context context) {
		super(context);
	}

	public void setTutorialPageLoaders(List<TutorialPageDataLoader> pageLoaders) {
		this.pageLoaders = pageLoaders;
		setCount(pageLoaders.size());
	}

	@Override
	public void updateSelected(int page) {
		super.updateSelected(page);
		if (page < pageLoaders.size())
			pageLoaders.get(page).loadData();
	}
}
